<?php 
$obj = array('name'=>'lisi','age'=>29);
echo json_encode($obj);

$obj1 = array('a','b','c');
echo json_encode($obj1);

class Dog{
	public $le = 4;
	public $color = 'yellow';
	public function col(){
		echo $this->color;
	}
}
echo json_encode(new Dog());

$str = "{'name':'lisi','age':29} ";
print_r(json_decode($str));

$obj2 = json_decode($str);
$obj2->name;
print_r(json_decode($str,ture));